package com.mzpai.product.util;

import com.mzpai.product.exception.ProductResException;
import com.mzpai.product.exception.ProductResExceptionCode;

public class ServiceChargeUtil {
	
	/**
	 * 根据提现金额计算手续费(5万以下每次1元;5万以上每次10元)
	 * @param amount
	 * @return Double
	 * @throws Exception 
	 */
	public static Double countServiceCharge(Double amount){
		
		if(amount==null){
			throw new ProductResException(ProductResExceptionCode.AMOUNT_NULL.getCode(),ProductResExceptionCode.AMOUNT_NULL.getMessage());
		}
		
		Double serviceCharge=0d;
		//5万以下每次1元;5万以上每次10元
		if(amount<=50000){
			serviceCharge=1d;
		}else{
			serviceCharge=10d;
		}

		return serviceCharge;
	}



}
